<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
	</style>
</head>
<body>
	<input type="button" name="" value="点击按钮加载今日笑话" onclick="fun()">
	<div id="div">
		
	</div>
	<script src="jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		function fun(){
			
			var div = document.querySelector('#div');
			var sum = '一';
			$.ajax({
				type:'get',
				url:'http://v.juhe.cn/joke/content/list.php?sort=&page=2&pagesize=2&time=1418816972&key=4f9c7cf0e605378860dd677f0da9d74f',
				dataType: 'jsonp',
				success:function(d,s,x){
					for(var i in d.result.data){
						if(i==0){
							sum = '一'
						}else{
							sum = '二'
						}
						var index='<div>笑话'+sum+'：<br><p>'+d.result.data[i].content+'<p></div>';
						div.innerHTML+=index
					}
				}
			})
			
		}
	</script>
</body>
</html>